/*
 * @Version: 1.0
 * @Autor: yuchang
 * @Date: 2024-01-08 16:42:19
 * @LastEditors: yuchang
 * @LastEditTime: 2024-01-16 11:32:26
 * @Description:
 */
import { defineConfig } from '@umijs/max'
import myTheme from '../src/utils/theme/antd'
import pageRoutes from './routes'
// import px2rem from 'postcss-plugin-px2rem';
import webpackPlugin from './chunk'
import proxy from './proxy'
export default defineConfig({
  chainWebpack: webpackPlugin,
  nodeModulesTransform: {
    type: 'none',
  },
  inlineLimit: 20000,
  base: '/',
  publicPath: './',
  hash: true,
  theme: {
    ...myTheme,
  },
  proxy: proxy,
  /**
   * @name 国际化插件
   * @doc https://umijs.org/docs/max/i18n
   */
  history: {
    type: 'hash',
  },
  routes: pageRoutes,
  fastRefresh: {},
  outputPath: './Tenantry',
  chunks: ['vendors', 'antdesigns', 'default.umi', 'umi'],
  //配置 <head> 里的额外脚本，数组项为字符串或对象。
  headScripts: [],
  targets: { chrome: 49, firefox: 64, safari: 10, edge: 13, ios: 10 },
  analyze: {
    analyzerMode: 'server',
    analyzerPort: 8080,
    openAnalyzer: true,
    generateStatsFile: false,
    statsFilename: 'stats.json',
    logLevel: 'info',
    defaultSizes: 'parsed',
  },

  locale: {
    // default zh-CN
    default: 'zh-CN',
    antd: true,
    // default true, when it is true, will use `navigator.language` overwrite default
    baseNavigator: true,
  },
  define: {
    'process.env': { REACT_APP_ENV: process.env.REACT_APP_ENV },
  },
})
